package com.quanxiaoha.xiaohashu.kv.biz.controller;


import com.quanxiaoha.framework.common.response.Response;
import com.quanxiaoha.xiaohashu.kv.biz.service.NoteContentService;
import com.quanxiaoha.xiaohashu.kv.dto.req.AddNoteContentReqDTO;
import com.quanxiaoha.xiaohashu.kv.dto.req.DeleteNoteContentReqDTO;
import com.quanxiaoha.xiaohashu.kv.dto.req.FindNoteContentReqDTO;
import com.quanxiaoha.xiaohashu.kv.dto.rsp.FindNoteContentRspDTO;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: jingyan_liu
 * @CreateTime: 2025-07-25
 * @Description:
 * @Version: 1.0
 */


@RestController
@RequestMapping("/kv")
@Slf4j
public class NoteContentController {
	
	@Resource
	private NoteContentService noteContentService;
	
	@PostMapping(value = "/note/content/add")
	public Response<?> addNoteContent(@Validated @RequestBody AddNoteContentReqDTO addNoteContentReqDTO) {
		return noteContentService.addNoteContent(addNoteContentReqDTO);
	}
	
	@PostMapping(value = "/note/content/find")
	public Response<FindNoteContentRspDTO> findNoteContent(@Validated @RequestBody FindNoteContentReqDTO findNoteContentReqDTO) {
		return noteContentService.findNoteContent(findNoteContentReqDTO);
	}
	
	@PostMapping(value = "/note/content/delete")
	public Response<?> deleteNoteContent(@Validated @RequestBody DeleteNoteContentReqDTO deleteNoteContentReqDTO) {
		return noteContentService.deleteNoteContent(deleteNoteContentReqDTO);
	}
}

